home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 2000 November: Tool Chest / Dev.CD Nov 00 TC Disk 1.toast / Sample Code / Help Systems / MyHelpMenu / MyHelpMenu READ ME next >
Encoding:
Text File  |  2000-09-28  |  1.2 KB  |  30 lines  |  [TEXT/ttxt]

  1. MyHelpMenu READ ME
  2. =================
  3.  
  4. This sample code demonstrates how to append your own help menu items under the help menu.
  5. As an aside, it also shows how to implement hierarchical sub menus.
  6.  
  7. This is basically how you go about appending your own help menu items:
  8.  
  9.     MenuHandle                helpMenu;
  10.  
  11.     err = HMGetHelpMenuHandle (&helpMenu);
  12.  
  13.     if (helpMenu != nil) {
  14.         AppendMenu (helpMenu, "\pThis is my help...");
  15.     }
  16.  
  17. To check for your help menu selections events your menu choice handler looks for a menu ID of kHMHelpMenuID (-16490) and your specific help item's number (your first one will start at 5).
  18.  
  19. (The MyHelpMenu project is a CodeWarrior Pro 2 project.)
  20.  
  21. Side note:
  22. There is a bug that may or may not affect you. If you have code that switches menu bars by calling a GetMenuBar/SetMenuBar pair, your custom Help menu items will disappear. The bug is in GetMenuBar explicitly omitting system menus like the Help menu from the list it builds. This bug has already been logged in our bug database, it will be fixed in a future revision of the Mac OS. As of this writing, the bug is still not fixed in Mac OS 8.1.
  23.  
  24. Questions and comments about this sample code should go to: devsupport@apple.com.
  25.  
  26. Jason Yeo
  27. Apple Computer, Inc.
  28. Mac OS Developer Technical Support
  29.  
  30. 12/17/97